package com.mall.app.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;

import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 商品表
 * </p>
 *
 * @author LeeSin
 * @since 2020-07-10
 */
@ApiModel(value="TbGoods对象", description="商品表")
public class TbGoods extends Model<TbGoods> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "商品编号")
    @TableId(value = "gid", type = IdType.AUTO)
    private Integer gid;

    @ApiModelProperty(value = "商品名称")
    private String gname;

    @ApiModelProperty(value = "商品价格")
    private String price;

    @ApiModelProperty(value = "商品库存数量")
    private Integer quantity;

    @ApiModelProperty(value = "图片")
    private String images;

    @ApiModelProperty(value = "商品概述")
    private String gdesc;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    private LocalDateTime modifyTime;
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "商品类别")
    private TbCategory category;


    public TbCategory getCategory() {
		return category;
	}

	public void setCategory(TbCategory category) {
		this.category = category;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Integer getGid() {
        return gid;
    }

    public void setGid(Integer gid) {
        this.gid = gid;
    }

    public String getGname() {
        return gname;
    }

    public void setGname(String gname) {
        this.gname = gname;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public String getImages() {
        return images;
    }

    public void setImages(String images) {
        this.images = images;
    }

    public String getGdesc() {
        return gdesc;
    }

    public void setGdesc(String gdesc) {
        this.gdesc = gdesc;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(LocalDateTime modifyTime) {
        this.modifyTime = modifyTime;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }


    @Override
    protected Serializable pkVal() {
        return this.gid;
    }

    @Override
    public String toString() {
        return "TbGoods{" +
        "gid=" + gid +
        ", gname=" + gname +
        ", price=" + price +
        ", quantity=" + quantity +
        ", images=" + images +
        ", gdesc=" + gdesc +
        ", createTime=" + createTime +
        ", modifyTime=" + modifyTime +
        ", deleted=" + deleted +
        ", category=" + category.toString() +
        "}";
    }
}
